/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.rec.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Programador
 */
@Embeddable
public class CreditoCarteraPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ID_CARTERA", nullable = false)
    private long idCartera;
    @Basic(optional = false)
    @Column(name = "ID_CREDITO", nullable = false)
    private long idCredito;

    public CreditoCarteraPK() {
    }

    public CreditoCarteraPK(long idCartera, long idCredito) {
        this.idCartera = idCartera;
        this.idCredito = idCredito;
    }

    public long getIdCartera() {
        return idCartera;
    }

    public void setIdCartera(long idCartera) {
        this.idCartera = idCartera;
    }

    public long getIdCredito() {
        return idCredito;
    }

    public void setIdCredito(long idCredito) {
        this.idCredito = idCredito;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idCartera;
        hash += (int) idCredito;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CreditoCarteraPK)) {
            return false;
        }
        CreditoCarteraPK other = (CreditoCarteraPK) object;
        if (this.idCartera != other.idCartera) {
            return false;
        }
        if (this.idCredito != other.idCredito) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.rec.be.CreditoCarteraPK[idCartera=" + idCartera + ", idCredito=" + idCredito + "]";
    }

}
